{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "GEN_3_variation.ipynb",
      "provenance": [],
      "collapsed_sections": [],
      "authorship_tag": "ABX9TyNWGFVPXspj03GiTb2SNjA7",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/cxbxmxcx/GenReality/blob/master/GEN_3_variation.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XhB46Q8JTpBd"
      },
      "source": [
        "from sklearn.model_selection import train_test_split\n",
        "\n",
        "import numpy  as np\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "import torch\n",
        "import torch.nn as nn\n",
        "from scipy.stats import norm"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "9ITk0PPQb67p"
      },
      "source": [
        "def function(x):\n",
        "  return norm.logpdf(x)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tNHQgiXUUFIa",
        "outputId": "9c533170-e951-4c48-cb01-21398e01a1fa",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 285
        }
      },
      "source": [
        "X = np.random.rand(50,1) * 2 - 1\n",
        "y = function(X)\n",
        "inputs = X.shape[1]\n",
        "y = y.reshape(-1, 1)\n",
        "plt.plot(X, y, 'o', color='black')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7fd7697ae860>]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 29
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhE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1fMrOrVKtVvbfPMXTiUkk3uPtyQ1karl+iBpoE3P28mId4UtJpDb+fGpYtqlZFmgi/qdXLE4vPzH5iZie7+9PhB9QzLQ71UUl73f2VhmPXvwG/ZGbXSPpMt/ElFaO7Pxn+fNzM7pR0jqRvKSXX0MyOl3STal8O7mk4diLXcJWo91SzfZ4wswlJv6zae66T1/YjPpnZeaol2ne5+0v18oi/dZIfYm3jc/fFhl+/plrfUP2171712jsTjK2j+BpcKunTjQV9uH6diPo3rOv6DXtz0PcknWm1USwbVfuj7fNaL8kdqrXDS9JWSUnXLPaFx+3k+GvaFcMPvXrb+4clNR0J0OsYzeyEejOKmU1K+i1JD6flGoZ/172qtYHesGpbL65h0/dUi7g/Iun28Hrtk3Sp1UYPnS7pTEn/lUBMXcVnZudI+gdJH3L3ZxrKm/6tBxDfyQ2/fkjSofD5LZLeH8Z5gqT369jac1/iC2N8k2qdq3c3lPXj+nVin6Q/CEcJvUPST8MvROu7fr3u6V7vQ9JFqrVpvSTpJ5JuCctPkXRzw34XSHpUtWxcbig/Q7X/gIcl/Yuk4xKOb7Ok2yQ9Jmm/pE1h+bSkrzXsV1AtQ4+tev3tkh5U7YNrj6TX9eAato1R0m+GcXw//Hllmq6hpE9IekXS/Q2Ps3t5DZu9p1RrZvpQ+Pw14fU4HF6fMxpeWw5f94ikD/bo/0a7+PaH/2fq12tfu791n+P7S0kPhXHcIelNDa+9IryuhyVdPoj4wt+/IOmLq17Xr+t3nWqj4F5R7TPwSknbJG0Lt5ukr4bxP6iG0ZPruX7cMQwAGTbszUEAgBhIAgCQYSQBAMgwkgAAZBhJAAAyjCQAABlGEgCADCMJAECG/R/dygCL1yXRegAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "z05ZyUrmU7is",
        "outputId": "5bdfae48-87a3-431c-90b6-7940269b19ab",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)\n",
        "num_train = X_train.shape[0]\n",
        "X_train[:2], y_train[:2]\n",
        "num_train"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "40"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 30
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QLshQolGVUlz"
      },
      "source": [
        "torch.set_default_dtype(torch.float64)\n",
        "net = nn.Sequential(\n",
        "    nn.Linear(inputs, 50, bias = True), nn.ReLU(),\n",
        "    nn.Linear(50, 50, bias = True), nn.ReLU(),\n",
        "    nn.Linear(50, 50, bias = True), nn.Sigmoid(),\n",
        "    nn.Linear(50, 1)\n",
        ")\n",
        "loss_fn = nn.MSELoss()\n",
        "optimizer = torch.optim.Adam(net.parameters(), lr = .001)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZhR9h8Y3WCWM"
      },
      "source": [
        "num_epochs = 20000\n",
        "y_train_t = torch.from_numpy(y_train).clone().reshape(-1, 1)\n",
        "x_train_t = torch.from_numpy(X_train).clone()\n",
        "y_test_t = torch.from_numpy(y_test).clone().reshape(-1, 1)\n",
        "x_test_t = torch.from_numpy(X_test).clone()\n",
        "history = []"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Ef62jrN3WP0d",
        "outputId": "5e888732-2bdb-4376-da9f-701f592a0f71",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 173
        }
      },
      "source": [
        "for i in range(num_epochs):\n",
        "    y_pred = net(x_train_t)\n",
        "    loss = loss_fn(y_train_t,y_pred)\n",
        "    history.append(loss.data)    \n",
        "    loss.backward()\n",
        "    optimizer.step()\n",
        "    optimizer.zero_grad()  \n",
        "    test_loss = loss_fn(y_test_t,net(x_test_t))  \n",
        "    if i > 0 and i % 2000 == 0:\n",
        "        print(f'Epoch {i}, loss = {loss:.9f}, test loss {test_loss:.9f}')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Epoch 2000, loss = 0.000000178, test loss 0.000000375\n",
            "Epoch 4000, loss = 0.000000177, test loss 0.000000388\n",
            "Epoch 6000, loss = 0.000000175, test loss 0.000000378\n",
            "Epoch 8000, loss = 0.000000174, test loss 0.000000370\n",
            "Epoch 10000, loss = 0.000000157, test loss 0.000000358\n",
            "Epoch 12000, loss = 0.000000152, test loss 0.000000345\n",
            "Epoch 14000, loss = 0.000000146, test loss 0.000000337\n",
            "Epoch 16000, loss = 0.000000143, test loss 0.000000339\n",
            "Epoch 18000, loss = 0.000000135, test loss 0.000000331\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "IifIajH-XFrl",
        "outputId": "80eac69b-0db2-47ac-ebc0-110ab5f5b0c7",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 283
        }
      },
      "source": [
        "plt.plot(history)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7fd769c7b5c0>]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 36
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAD4CAYAAAAQP7oXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO29ebgeV3ng+XvvIsmWLclajHcksEgiE4wdxSHpkKSBiWXTWPRgMnYnGafjbk9PgCEhPY0dGgYY3MFhgtM0NgQwYMwiGwOxPF7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R8DPi+iExxlefhG4NLtwauZmTDpPL4SqgfWpLXCmo0RrMVODf29znWrTREpJsoQ3zPGPNjAGPMdmPMoDFmCPg6UZe8mX6l6G2M2Wr/3wH8xOqx3XZrh7vkO+rQjciQPWOM2W51DCLO8Bc/Wxk5hNSyfiLyF8C/Af7UVjbY4Z/d9vlpovmCt2SEn/aNufGYbruJhmO6GtwLY2X9r8CdMX0rja+k+qGJvPLzmMtkzHj6R3Rv+jqiibfhSbYLSgxPiMYR/6nB/czY898Qje0CXMDIycF1RBOD3vUGJgOnxp6fIJqL+AIjJ+H+wT6/l5GTcMut+3RgPdEE3Gn2ebqHuFsE/Pu644yGiVGf8cPoScrLW9BrAbAamNXgbxbQaZ/fRFRpNA0/7RsL6uUt3Yh6nfGJ8L8qqlcszh6pK75Irx9qy2OlVITt/o9oBcIrRC2IT5Qc1u8TdS2fB561/y4H7gBesO6LGwrWJ6xua4itdPCtty0Qz9l/q4ZlEo0d/wJ4Ffh5LPMJcIsN/wVgfkzWXxJNZPYQq+hb0G0yUctyasyt8jgjGrbYBvQTjQdf6zN+gPnAi/adL2NPcSioVw/RuPZwPvuq9fsBm77PAs8A78sKP+0bC+rlLd1snl1uv/WHwMSieln3bwP/qcFvlfGVVj/Ulsf0GBFFURTFGZ3TUBRFUZxRo6EoiqI4o0ZDURRFcUaNhqIoiuKMGg1FURTFGTUaiqIoijNqNBRFURRn/ieB5lXrBmneCAAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZJXQixjLhDkt",
        "outputId": "ae28d9c3-acf0-4d41-de95-392e30100b04",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 285
        }
      },
      "source": [
        "X_a = torch.rand(25,1).clone() * 2 - 1\n",
        "y_a = net(X_a)\n",
        "y_a = y_a.detach().numpy()\n",
        "plt.plot(X_a, y_a, 'o', color='black')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7fd769b3eda0>]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 38
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD7CAYAAABt0P8jAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAUn0lEQVR4nO3dfYxlZX3A8e9vee3EWIElvIg7Aw3WEmvBTC3UpCJSwdWIUFHMICtopohtbFpSMfcPbZOJ2qS1aauhE7QKnaoU3UAFg7xm21TQpQVc2AIr7qwryMtafMlGEPbXP+6Z7WX33rkzc+7LmXu+n2Sy957z3Pv89rl3fnPOc57zPJGZSJLqY82wA5AkDZaJX5JqxsQvSTVj4pekmjHxS1LNmPglqWZKJf6IODwibomIR4p/D+tQ7lMRsaX4eXeZOiVJ5ZQ94r8CuC0zTwRuK56/SES8FXgtcDLwO8DlEfHSkvVKklbowJKvPwc4vXj8ReBO4CP7lDkJ2JSZzwPPR8T9wNnAtd3efO3atTkxMVEyREmqj3vuuefpzDxysTJlE/9Rmfl48fhHwFFtytwHfCwi/hoYA94IPLiUN5+YmGDz5s0lQ5Sk+oiI+W5luib+iLgVOLrNrkbrk8zMiNhv/ofM/GZE/Dbwn8BTwLeAFxapbxqYBli3bl238CRJy9Q18WfmmZ32RcQTEXFMZj4eEccAT3Z4jxlgpnjNvwAPL1LfLDALMDk56URCktRjZS/u3gBsKB5vAK7ft0BEHBARRxSPXwO8BvhmyXolSStUto//k8C1EfF+YB54F0BETAKXZuYHgIOAf48IgJ8CFxYXeiVJQ1Aq8WfmLuBNbbZvBj5QPP4FzZE9kqQK8M5dCZibm2N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aw7E+AvzlEOIbz8wfRsQJwO0R8V2aiawnetyG1wAbMnNhYr/SbTjqIuJCYBJ4Q8vm/T7zzPxe+3foq38DvpSZz0bEH9I8izpjCHF0cwFwXWa+0LKtKm3YMwNJ/Jl5Zsm3+CHwipbnxxXbdtE85TmwOBpb2N7TGCPiiYg4JjMfL5LSk4u81buAjZn5y5b3XjjSfTYi/gm4fBjxZeYPi38fjeY0G6cAX6VCbRgRLwVupHlQcFfLe5duwzY6fa/aldkZEQcCv0rze7eU1/bCkuqJiDNp/oF9Q2Y+u7C9w2fe66TVNcbM3NXy9Cqa13wWXnv6Pq+9c9DxtbgA+FDrhgG1YTed/g8rar/V0tXzHeDEaI4+OZjmh3NDNq9u3EGzTx1gA9CPM4gbivdeSh379Q8WiW6hP/0dNBewGWh8EXHYQvdIRKwFXg88WKU2LD7bjTT7Mq/bZ18/2rDt92qRuN8J3F602Q3ABdEc9XM8cCLw7R7EtOwYI+IU4B+Bt2fmky3b237mQ4rxmJanb+f/F2W6GXhzEethwJt58dnyQOIrYnwVzQuk32rZNqg27OYG4KJidM+pwE+Kg6GVtV+/r1Z3+wHOpdkv9SzwBHBzsf1Y4KaWcuuBh2n+pW20bD+B5i/cNuBfgUP6EOMRwG3AI8CtwOHF9kngqpZyEzT/Aq/Z5/W3A9+lmaz+GXjJoOMDfreI4b7i3/dXrQ2BC4FfAve2/JzczzZs972i2YX09uLxoUWbbCva6ISW1zaK1z0EvKWPvyPdYry1+N1ZaLMbun3mQ4jxE8ADRSx3AK9qee0lRftuAy4eRnzF848Dn9zndQNpQ5oHi48X3/+dNK/VXApcWuwP4DNF/N+lZQTkStrPO3clqWZWS1ePJKlHTPySVDMmfkmqGRO/JNWMiV+SasbEL0k1Y+KXpJox8UtSzfwfmu9ttDptNbIAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    }
  ]
}